<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>12.响应式布局</title>
  <style>
    @media only screen and (max-width: 374px) {
      /* iphone5 */
      html {
        font-size: 86px;
      }
    }
    @media only screen and (min-width: 375px) and (max-width: 413px) {
      /* iphone6/7/8 */
      html {
        font-size: 100px;
      }
    }
    @media only screen and (min-width: 414px) {
      /* iphone6/7/8 */
      html {
        font-size: 110px;
      }
    }

    body {
      font-size: .16rem;
    }

    #div1 {
      width: 1rem;
      background-color: #ccc;
    }

  </style>
</head>
<body>

  <div id='div1'>
    this is div
  </div>

</body>
</html>